﻿using HW.Application.PlcBusiness.Services;
using HW.Application.Share.Events;
using HW.Application.Share.Prism;
using HW.Core.Extension;
using HW.Core.Ioc;
using HW.Database.SQLServer.Repository;
using Prism.Events;
using Prism.Ioc;
using Prism.Modularity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace HW.Application.PlcBusiness
{
 
    [Module(ModuleName = ModuleNames.ApplicationPlcBusinessModule, OnDemand = true)]
    public class ApplicationPlcBusinessModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            containerProvider.InitializeAssembly(Assembly.GetExecutingAssembly());
            //IRotorInformationRepository informationRepository = containerProvider.Resolve<IRotorInformationRepository>();

            PlcService plcService = new PlcService();
            plcService.Start();
        }



        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterAssembly(Assembly.GetExecutingAssembly());
        }
    }
}
